<?php

namespace app\mobile\controller;


use app\admin\model\Aboutus as AboutusModel;

class Aboutus extends Base
{
    public function index()
    {
        $data = AboutusModel::order('id', 'desc')->paginate(3);
        $id = $this->request->param('id');
        if ($id == null) {
            $content = $data[0];
            $title = $data[0]['title'];
        } else {
            $content = AboutusModel::where('id', $id)->find();
            $title = $content['title'];
        }
        $this->assign([
            'content' => $content,
            'title' => $title,
            'id' => $id,
            'data' => $data,
            'menu' => 'aboutus',

        ]);
        return $this->fetch();
    }
}